package cn.fanqinghong.ymcc.feignClient;

import cn.fanqinghong.ymcc.domain.MessageStation;
import cn.fanqinghong.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * FAN
 * 2022/7/25  13:59
 */
@Component
public class MessageStationFallbackFactory implements FallbackFactory<MessageStationFeignClient> {
    @Override
    public MessageStationFeignClient create(Throwable throwable) {
        return new MessageStationFeignClient() {
            @Override
            public JSONResult saveBatch(List<MessageStation> messageStations) {
                return JSONResult.error("保存数据错误");
            }

        };
    }
}
